import {FormItemRule} from "element-plus";

export interface AutoFormProps{
    model:Record<string, AutoFormItem>;
    title:string;
    dialogVisible:boolean;
}

export interface AutoFormItem{
    key:string;
    name:string;
    value:string|number|boolean;
    itemType:string;
    options?:SelectOptionsInterface[]|DatePickerOptionsInterface|RadioOptionsInterface[];
    placeholder?:string;
    rules?:FormItemRule;
}
export interface AutoFormEmits{
    (event: 'onSubmit', data: any):void;
    (event: 'onCancel'):void;
    (event: 'handleUpload',url:string):void;
}
export interface SelectOptionsInterface{
    label:string;
    value:any;
}
export interface DatePickerOptionsInterface{
    type:string;
    valueFormat:string;
}
export interface RadioOptionsInterface{
    label:string;
    value:any;
}